import { Outlet } from "react-router-dom";
import Header from "./header";
import Menu from "./menu";
import useShowMenu from "@/hooks/useShowMenu";
import { useEffect } from "react";
import { useDispatch } from "react-redux";

function Layout() {
	const hasMenu = useShowMenu();
	const dispatch = useDispatch();
	useEffect(() => {
		// dispatch(get_menu_async());
	});
	return (
		<div className="layout">
			<div className="header_wrap">
				<Header />
			</div>
			<div className="layout_main">
				{hasMenu ? (
					<div className="menu_wrap">
						<Menu />
					</div>
				) : null}

				<div className="main_wrap">
					<Outlet />
				</div>
			</div>
		</div>
	);
}

export default Layout;
